Support reference library directives#7549
Support reference library directives#7549RyanCavanaugh wants to merge 2 commits intomicrosoft:masterfrom
Conversation
|
|
||
| function getEffectiveLibraryPrimarySearchPaths() { | ||
| return options.librarySearchPaths || | ||
| (options.configFilePath ? |
There was a problem hiding this comment.
Interesting... so if the user provides librarySearchPaths, they effectively override all 3 of the defaults?
Also, why is the configFilePath added to the front? Does this mean if I have my tsconfig file in my ./src project root, an it tries to load a jquery typing, it will first look for ./src/jquery/ (and see if there is a package.json with a typing field)?
There was a problem hiding this comment.
Correct.
I removed "" from the list of default search paths.
5f72495 to
c0537cd
Compare
|
Anyone else care to take a look? |
c0537cd to
30cb987
Compare
src/compiler/diagnosticMessages.json
Outdated
| "category": "Error", | ||
| "code": 4082 | ||
| }, | ||
| "Conflicting library definitions for '{0}' found at '{1}' and '{2}'. Copy the correct file to a local typings folder to resolve this conflict.": { |
There was a problem hiding this comment.
nit, missing quotes: .. local 'typings' folder ..
There was a problem hiding this comment.
possibly: Copy the correct file to the local 'typings' folder
There was a problem hiding this comment.
Changed to suggested text
| (options.rootDir && ts.toPath(options.rootDir, currentDirectory, host.getCanonicalFileName)) || | ||
| (options.configFilePath && getDirectoryPath(getNormalizedAbsolutePath(options.configFilePath, currentDirectory))); | ||
| if (libraryRoot === undefined) { | ||
| libraryRoot = computeCommonSourceDirectoryOfFilenames(rootNames); |
There was a problem hiding this comment.
this is kinda unexpected. so tsc a.ts will result in a different search location from tsc a\a.ts b\b.ts, even if a.ts has a reference to b.ts?
I would say make it an error to try to resolve a library reference, without a root, and ask the user to specify rootDir.
|
closing in favor of #7775 |
Implements #7156. I'll update that issue with a more detailed design description